//
//  BLRoomItem.swift
//  BLLiveTelecast
//
//  Created by BigL055 on 16/6/1.
//  Copyright © 2016年 bigL.liveTelecast.com. All rights reserved.
//

import UIKit

class BLRoomItem: NSObject {

    var room_id : String? = ""
    var fans : String? = ""
    
    //自动选择线路
    var autoLiveUrl : String? = ""
    //HLS线路
    var hls_url : String? = ""
    //RTMP线路
    var RTMP_URL : String? = ""
    var rtmp_live : String? = ""
    var rtmp_url : String? = ""
    
    
    
    class func initWithDict(dict : [String : AnyObject]) -> BLRoomItem{
        let item = BLRoomItem()
        item.setValuesForKeysWithDictionary(dict)
        
        if item.hls_url != "" {
            item.autoLiveUrl = item.hls_url
        }
        else if item.rtmp_url != nil && item.rtmp_live != nil {
            item.RTMP_URL = item.rtmp_url! + "/" + item.rtmp_live!
            item.autoLiveUrl = item.RTMP_URL
        }
        else{
            
        }
        
        return item
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
 
}
